<p:dialog xmlns="http://www.w3.org/1999/xhtml"
      	  xmlns:h="http://java.sun.com/jsf/html"
      	  xmlns:f="http://java.sun.com/jsf/core"
      	  xmlns:ui="http://java.sun.com/jsf/facelets"
      	  xmlns:p="http://primefaces.org/ui"
      	  modal="true"  resizable="true" width="30%"
		  widgetVar="dialogTrancarMatricula" id="idDialogTrancarMatricula" closable="true"
		  appendTo="@(body)" header="Trancar Matrícula"> 	
  	
	 <link rel="stylesheet" type="text/css" href="./estilos.css"/>  
<h:form id="formDialogTrancarMatricula" prependId="false">
<h:panelGroup id="pgDialogTrancarMatricula">

 	<p:messages id="messagesTrancamento" autoUpdate="true" closable="true" /> 
        <h:panelGrid id="pgDialoDtTrancamento"  columns="4" style="margin-top:20px; margin-right:10%; margin-bottom:15px;">  
            <h:outputLabel value="Data do trancamento" styleClass="outputLabel"/> 
            <h:outputLabel value="Período (dias)" />
            <h:outputLabel value="Data final do trancamento" styleClass="outputLabel"/>
            <h:outputLabel  />
            <p:inputMask mask="99/99/9999" value="#{matriculaBean.matricula.dtInicioTranc}" styleClass="inputData" style="width:135px" disabled="true">
            	<f:convertDateTime dateStyle="medium"/>
            </p:inputMask>  
            <p:inputText id="idDias" value="#{matriculaBean.matricula.diasTrancada}" style="width:80px; height:16px;" maxlength="3">
            	<p:ajax listener="#{matriculaBean.calculaDtFinal}" update="idDialogDtFinalTranc"/>
            </p:inputText>
  			<p:inputMask id="idDialogDtFinalTranc" mask="99/99/9999" value="#{matriculaBean.matricula.dtFinalTranc}" styleClass="inputData" style="width:135px" >
  				<f:convertDateTime dateStyle="medium"/>
  				<p:ajax listener="#{matriculaBean.validaDataTrancamento}" update="messagesTrancamento, idDias"/>
  			</p:inputMask> 
    	</h:panelGrid>  
    <p:commandButton value="Trancar" actionListener="#{matriculaBean.trancarMatricula}" process="@this" styleClass="commandButton" />
	<p:commandButton value="Cancelar"  onclick="dialogTrancarMatricula.hide()" immediate="true" styleClass="commandButton" />
 </h:panelGroup>
 </h:form>
</p:dialog>
